#include "task.h"

Task::Task(QWidget *parent, int time)
	: QWidget(parent), snaptime(time)
{
	ui.setupUi(this);

	int sec = snaptime % 60;
	int min = snaptime / 60;
	int hour = min / 60;
	min %= 60;
	QString str = QString::number(hour) + ":" + QString::number(min) + ":" + QString::number(sec);
	ui.snaptime->setText(str);
	ui.snaptime->setEnabled(false);
	connect(ui.pushButton, SIGNAL(clicked()), this, SLOT(tsk_btn_del_clicked()));
}

Task::~Task()
{
}

void Task::tsk_btn_del_clicked()
{
	emit btn_del_clicked(snaptime);
	this->deleteLater();
}
